<?php

require_once(__DIR__ . '/../../vendor/youzanyun/yz-cloud-boot/boot/functions.php');

init();
fixDevelopServer();


use PinWuYun\command\li\SyncGoods;
use PinWuYun\command\li\UpdateGoods;
use PinWuYun\command\TestCmd;
use PinWuYun\domain\manager\ManagerApp;
use Symfony\Component\Console\Application;
use YouzanCloudBoot\Boot\Bootstrap;
use YouzanCloudBoot\Facades\Facade;

// 初始化容器
/** @var \Psr\Container\ContainerInterface $container */
$container = YouzanCloudBoot\Boot\Bootstrap::setupContainer();


// 初始化应用
$app = new \Slim\App($container);
Bootstrap::setupApp($app);
Facade::setFacadeApplication($app);
// 注册laravel db
ManagerApp::registerDb();

// 注册命令行
$application = new Application();
/** 使用add方法，添加命令行,命令命令名称在文件内定义 */
$application->add(new TestCmd("hello console"));
$application->add(new SyncGoods());
$application->add(new UpdateGoods());
$application->run();